#!/usr/bin/env python
import rospy
from sensor_msgs.msg import JointState
import math

def joint_state_publisher():
    rospy.init_node('joint_state_publisher', anonymous=True)
    pub = rospy.Publisher('joint_states', JointState, queue_size=10)
    rate = rospy.Rate(50)  # 50Hz

    joint_state = JointState()
    joint_state.name = ['joint{}'.format(i+1) for i in range(7)]
    angle = 0.0

    while not rospy.is_shutdown():
        angle += 0.01
        joint_state.header.stamp = rospy.Time.now()
        # joint_state.position = [-2.72632, 1.21978, -1.0527, 1, 0, 0, 0]
        # joint_state.position = [0.0] * 7
        joint_state.position = [1.0] * 7
        joint_state.velocity = [0.0] * 7
        joint_state.effort = [0.0] * 7

        pub.publish(joint_state)
        rate.sleep()

if __name__ == '__main__':
    try:
        joint_state_publisher()
    except rospy.ROSInterruptException:
        pass

